package cn.genmer.test.security.model;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * <p>功能描述：</p>
 * <p>Copyright: Copyright (c) 2019</p>
 * <p>Company: 中通快运</p>
 *
 * @author ZengGuoQiang
 * @version 1.0
 * @date 2019/9/4  15:24
 */
@Document
public class SiteMapVO implements Serializable {
    @Id
    private Object _id;
    /**
     * 网点ID
     **/
    private Long siteId;
    /**
     * 网点名称
     **/
    private String siteName;
    /**
     * 网点编码
     **/
    private String siteCode;
    /**
     * 网点地址
     **/
    private String siteAddress;
    /**
     * 网点类型
     **/
    private Long siteTypeId;
    /**
     * 网点状态
     **/
    private Integer siteStatus;
    /**
     * 网点所属网点
     **/
    private Long siteParentSiteId;
    /**
     * 网点所属省份ID
     **/
    private Long siteProvinceId;
    /**
     * 网点所属城市ID
     **/
    private Long siteCityId;
    /**
     * 网点所属省区
     **/
    private Long siteProvinceAreaId;
    /**
     * 网点所属大区ID
     **/
    private Long siteBigAreaId;
    /**
     * 网点坐标
     **/
    private String areaPoint;
    /**
     * 网点地图
     **/
    private String areaPolygon;
    /**
     * 地图类型 1：网点地图 2：市区派费地图 3：市区三超限行区域地图
     **/
    private Integer areaType;
    /**
     * 网点面积
     **/
    private Double siteAcreage;
    /**
     * 服务方式
     **/
    private Integer siteServicesType;
    /**
     * 网点地图审核表ID
     **/
    private Long areaReviewId;
    /**
     * 网点地图创建人
     **/
    private Long areaCreateBy;
    /**
     * 网点地图创建时间
     **/
    private String areaCreateTime;
    /**
     * 网点地图生效人
     **/
    private Long areaEffectBy;
    /**
     * 网点地图生效时间
     **/
    private String areaEffectTime;
    /**
     * 网点地图作废人
     **/
    private Long areaCancelBy;
    /**
     * 网点地图作废时间
     **/
    private String areaCancelTime;
    /**
     * 网点地图作废审核ID
     **/
    private Long areaCancelReviewId;
        /**
     * 合同物流客户编码
     **/
    private String contractLogisticsCode;

    public String getContractLogisticsCode() {
        return contractLogisticsCode;
    }

    public void setContractLogisticsCode(String contractLogisticsCode) {
        this.contractLogisticsCode = contractLogisticsCode;
    }

    public Object get_id() {
        return _id;
    }

    public void set_id(Object _id) {
        this._id = _id;
    }

    public Long getSiteId() {
        return siteId;
    }

    public void setSiteId(Long siteId) {
        this.siteId = siteId;
    }

    public String getSiteName() {
        return siteName;
    }

    public void setSiteName(String siteName) {
        this.siteName = siteName;
    }

    public String getSiteCode() {
        return siteCode;
    }

    public void setSiteCode(String siteCode) {
        this.siteCode = siteCode;
    }

    public String getSiteAddress() {
        return siteAddress;
    }

    public void setSiteAddress(String siteAddress) {
        this.siteAddress = siteAddress;
    }

    public Long getSiteTypeId() {
        return siteTypeId;
    }

    public void setSiteTypeId(Long siteTypeId) {
        this.siteTypeId = siteTypeId;
    }

    public Integer getSiteStatus() {
        return siteStatus;
    }

    public void setSiteStatus(Integer siteStatus) {
        this.siteStatus = siteStatus;
    }

    public Long getSiteParentSiteId() {
        return siteParentSiteId;
    }

    public void setSiteParentSiteId(Long siteParentSiteId) {
        this.siteParentSiteId = siteParentSiteId;
    }

    public Long getSiteProvinceId() {
        return siteProvinceId;
    }

    public void setSiteProvinceId(Long siteProvinceId) {
        this.siteProvinceId = siteProvinceId;
    }

    public Long getSiteCityId() {
        return siteCityId;
    }

    public void setSiteCityId(Long siteCityId) {
        this.siteCityId = siteCityId;
    }

    public Long getSiteProvinceAreaId() {
        return siteProvinceAreaId;
    }

    public void setSiteProvinceAreaId(Long siteProvinceAreaId) {
        this.siteProvinceAreaId = siteProvinceAreaId;
    }

    public Long getSiteBigAreaId() {
        return siteBigAreaId;
    }

    public void setSiteBigAreaId(Long siteBigAreaId) {
        this.siteBigAreaId = siteBigAreaId;
    }

    public String getAreaPoint() {
        return areaPoint;
    }

    public void setAreaPoint(String areaPoint) {
        this.areaPoint = areaPoint;
    }

    public String getAreaPolygon() {
        return areaPolygon;
    }

    public void setAreaPolygon(String areaPolygon) {
        this.areaPolygon = areaPolygon;
    }

    public Integer getAreaType() {
        return areaType;
    }

    public void setAreaType(Integer areaType) {
        this.areaType = areaType;
    }

    public Double getSiteAcreage() {
        return siteAcreage;
    }

    public void setSiteAcreage(Double siteAcreage) {
        this.siteAcreage = siteAcreage;
    }

    public Integer getSiteServicesType() {
        return siteServicesType;
    }

    public void setSiteServicesType(Integer siteServicesType) {
        this.siteServicesType = siteServicesType;
    }

    public Long getAreaReviewId() {
        return areaReviewId;
    }

    public void setAreaReviewId(Long areaReviewId) {
        this.areaReviewId = areaReviewId;
    }

    public Long getAreaCreateBy() {
        return areaCreateBy;
    }

    public void setAreaCreateBy(Long areaCreateBy) {
        this.areaCreateBy = areaCreateBy;
    }

    public Long getAreaEffectBy() {
        return areaEffectBy;
    }

    public void setAreaEffectBy(Long areaEffectBy) {
        this.areaEffectBy = areaEffectBy;
    }

    public Long getAreaCancelBy() {
        return areaCancelBy;
    }

    public void setAreaCancelBy(Long areaCancelBy) {
        this.areaCancelBy = areaCancelBy;
    }

    public String getAreaCreateTime() {
        return areaCreateTime;
    }

    public void setAreaCreateTime(String areaCreateTime) {
        this.areaCreateTime = areaCreateTime;
    }

    public String getAreaCancelTime() {
        return areaCancelTime;
    }

    public void setAreaCancelTime(String areaCancelTime) {
        this.areaCancelTime = areaCancelTime;
    }

    public Long getAreaCancelReviewId() {
        return areaCancelReviewId;
    }

    public void setAreaCancelReviewId(Long areaCancelReviewId) {
        this.areaCancelReviewId = areaCancelReviewId;
    }

    public String getAreaEffectTime() {
        return areaEffectTime;
    }

    public void setAreaEffectTime(String areaEffectTime) {
        this.areaEffectTime = areaEffectTime;
    }

    @Override
    public String toString() {
        return "SiteMapVO{" +
                "siteId=" + siteId +
                ", siteName='" + siteName + '\'' +
                ", siteCode='" + siteCode + '\'' +
                ", siteAddress='" + siteAddress + '\'' +
                ", siteTypeId=" + siteTypeId +
                ", siteStatus=" + siteStatus +
                ", siteParentSiteId=" + siteParentSiteId +
                ", siteProvinceId=" + siteProvinceId +
                ", siteCityId=" + siteCityId +
                ", siteProvinceAreaId=" + siteProvinceAreaId +
                ", siteBigAreaId=" + siteBigAreaId +
                ", areaPoint='" + areaPoint + '\'' +
                ", areaPolygon='" + areaPolygon + '\'' +
                ", areaType=" + areaType +
                ", siteAcreage=" + siteAcreage +
                ", siteServicesType=" + siteServicesType +
                ", areaReviewId=" + areaReviewId +
                ", areaCreateBy=" + areaCreateBy +
                ", areaCreateTime='" + areaCreateTime + '\'' +
                ", areaEffectBy=" + areaEffectBy +
                ", areaEffectTime='" + areaEffectTime + '\'' +
                ", areaCancelBy=" + areaCancelBy +
                ", areaCancelTime=" + areaCancelTime +
                ", areaCancelReviewId=" + areaCancelReviewId +
                '}';
    }

    public static JSONObject getSiteMapVOJSON(SiteMapVO siteMapVO) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("siteId", siteMapVO.getSiteId());
        jsonObject.put("siteName", siteMapVO.getSiteName());
        jsonObject.put("siteCode", siteMapVO.getSiteCode());
        jsonObject.put("siteAddress", siteMapVO.getSiteAddress());
        jsonObject.put("siteTypeId", siteMapVO.getSiteTypeId());
        jsonObject.put("siteStatus", siteMapVO.getSiteStatus());
        jsonObject.put("siteParentSiteId", siteMapVO.getSiteParentSiteId());
        jsonObject.put("siteProvinceId", siteMapVO.getSiteProvinceId());
        jsonObject.put("siteCityId", siteMapVO.getSiteCityId());
        jsonObject.put("siteProvinceAreaId", siteMapVO.getSiteProvinceAreaId());
        jsonObject.put("siteBigAreaId", siteMapVO.getSiteBigAreaId());
        JSONObject aePntObject = new JSONObject();
        aePntObject.put("type", "Point");
        aePntObject.put("coordinates", JSONArray.parseArray(siteMapVO.getAreaPoint()));
        jsonObject.put("areaPoint", aePntObject);
        JSONObject aePolyObject = new JSONObject();
        aePolyObject.put("type", "Polygon");
        aePolyObject.put("coordinates", JSONArray.parseArray(siteMapVO.getAreaPolygon()));
        jsonObject.put("areaPolygon", aePolyObject);
        jsonObject.put("areaType", siteMapVO.getAreaType());
        jsonObject.put("siteServicesType", siteMapVO.getSiteServicesType());
        jsonObject.put("areaReviewId", siteMapVO.getAreaReviewId());
        jsonObject.put("areaCreateBy", siteMapVO.getAreaCreateBy());
        jsonObject.put("areaCreateTime", siteMapVO.getAreaCreateTime());
        jsonObject.put("areaEffectBy", siteMapVO.getAreaEffectBy());
        jsonObject.put("areaEffectTime", siteMapVO.getAreaEffectTime());
        jsonObject.put("areaCancelBy", siteMapVO.getAreaCancelBy());
        jsonObject.put("areaCancelTime", siteMapVO.getAreaCancelTime());
        jsonObject.put("areaCancelReviewId", siteMapVO.getAreaCancelReviewId());
        jsonObject.put("contractLogisticsCode", siteMapVO.getContractLogisticsCode());
        return jsonObject;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        SiteMapVO siteMapVO = null;
        try{
            siteMapVO = (SiteMapVO)super.clone();
        }catch(CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return siteMapVO;
    }
}
